import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '../views/login.vue'
import home from '../views/home.vue'
import welcome from '../views/welcome.vue'
import users from '../views/users.vue'
import rights from '../views/rights.vue'
import roles from '../views/roles.vue'
import goods from '../views/goods.vue'
import params from '../views/params.vue'
import categories from '../views/categories.vue'
import orders from '../views/orders.vue'
import reports from '../views/reports.vue'
import add from '../views/add.vue'
Vue.use(VueRouter)

const routes = [{
    path: '*',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'login',
    component: login
  },
  {
    path: '/home',
    name: 'home',
    component: home,
    redirect: '/welcome',
    children: [{
        path: '/welcome',
        name: 'welcome',
        component: welcome
      },
      {
        path: '/users',
        name: 'users',
        component: users
      },
      {
        path: '/rights',
        name: 'rights',
        component: rights
      },
      {
        path: '/roles',
        name: 'roles',
        component: roles
      },
      {
        path: '/goods',
        name: 'goods',
        component: goods
      },
      {
        path: '/params',
        name: 'params',
        component: params
      },
      {
        path: '/categories',
        name: 'categories',
        component: categories
      },
      {
        path: '/orders',
        name: 'orders',
        component: orders
      },
      {
        path: '/reports',
        name: 'reports',
        component: reports
      },
      {
        path: '/add',
        name: 'add',
        component: add
      },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router